//
// Created by 34649 on 2022/3/4.
//

#ifndef AYIN_MUDUO_HTTP_RESPONSE_H
#define AYIN_MUDUO_HTTP_RESPONSE_H
#include "http_type.h"
#include "http_decoder.h"
#include <fstream>
#include <sstream>
namespace http{
    class http_response{

    private:
        HTTP_VERSION httpVersion;
        HTTP_CODE httpCode;
        hmap _map;        // 请求头 key:value
        string _content;
        string server;
    public:
        string serialize();//转换为string，发送给客户端
        bool setHttpCode(HTTP_CODE hc);
        bool setHttpVersion(HTTP_VERSION version);//设置http版本
        bool setContent(string content);//设置内容,记得更改content_length和content_type这两个header
        bool appendContent(string content);//添加内容
        bool setHeader(string key,string value);//设置header内容
        http_response();
    };
}
#endif //AYIN_MUDUO_HTTP_RESPONSE_H
